<?php
class TipoPersona extends AppModel {
	var $name = 'TipoPersona';
	var $useTable = 'tipos_personas';
	var $displayField = 'nombre';
	var $validate = array(
		'id' => array(
			'blank' => array(
				'rule' => array('blank'),
				'on' => 'create' 
			)
		),
		'nombre' => array(
			'maxlength' => array(
				'rule' => array('maxLength', '100')
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		)
	);

	var $hasAndBelongsToMany = array(
		'Persona' => array(
			'className' => 'Persona',
			'joinTable' => 'personas_tipos_personas',
			'foreignKey' => 'tipo_persona_id',
			'associationForeignKey' => 'persona_id',
			'unique' => true
		)
	);
}
?>